﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Scripting;

namespace DlrBasic.Parser.Ast
{
    class Line : DlrBasicNode
    {
        int lineNumber;

        public int LineNumber
        {
            get { return lineNumber; }
        }

        Statement[] statements;

        public Line(SourceSpan span, int lineNumber, Statement[] statements)
            : base(span)
        {
            this.lineNumber = lineNumber;
            this.statements = statements;
        }

        public void Visit(StatementsVisitor visitor)
        {
            visitor.Line(this);
            foreach (Statement statement in statements)
            {
                statement.Visit(visitor);
            }
        }

        internal Statement GetFirstStatement()
        {
            return statements[0];
        }
    }
}
